using HTCollections.Unsafe;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using Unity.Mathematics;

namespace HTCollections.Job
{
    [BurstCompile]
    public struct KdTreeQueryJob : IJob
    {
        [ReadOnly] public UnsafeKdTree2D KdTree;
        [ReadOnly] public float3 Pos;
        [ReadOnly] public float Range;
        [WriteOnly] public NativeList<float3> Result;

        public void Execute()
        {
            KdTree.QueryNeighborList(Pos, Range, ref Result);
        }
    }
}